package com.zzb.entity;

import lombok.Data;
import org.springframework.context.annotation.Scope;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.stereotype.Component;


@Data
@Component
@Scope("prototype")
@Document(indexName = "user")
public class UserEntity {
    @Id
    private Long id;//主键
    @Field(type = FieldType.Text, name = "username", analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String username;//姓名
    @Field(type = FieldType.Text, name = "password")
    private String password;//密码
    @Field(type = FieldType.Text, name = "old_password")
    private String oldPassword;//密码
    @Field(type = FieldType.Keyword, name = "sex")
    private String sex;//性别
    @Field(type = FieldType.Text, name = "phone")
    private String phone;//电话
    @Field(type = FieldType.Text, name = "email")
    private String email;//邮箱
    private Integer page;
    private Integer limit;
    @Field(type = FieldType.Text, name = "address", analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String address;//地址
    @Field(type = FieldType.Text, name = "birthday")
    private String birthday;//生日
    @Field(type = FieldType.Text, name = "start_birthday")
    private String startBirthday;//生日
    @Field(type = FieldType.Text, name = "end_birthday")
    private String endBirthday;//生日
    @Field(type = FieldType.Text, name = "create_time")
    private String createTime;//创建时间
    @Field(type = FieldType.Text, name = "update_time")
    private String updateTime;//更新时间
    @Field(type = FieldType.Integer, name = "enable")
    private Integer enable;//启用，停用
    @Field(type = FieldType.Text, name = "remark", analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String remark;//标记 ，备注,备用
    //版本，用于做乐观锁
    @Field(type = FieldType.Long, name = "version")
    private Long version;

}
